package com.zhuiYun.project.api.dynamicAudit.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author mao
 * @date 4.5 14:02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Table(name = "dynamic_comment")
public class DynamicAudit implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //主键id
    private Integer id;

    //用户id
    private Integer userId;

    //用户名
    private String userName;

    //用户名称
    @Transient
    private String nickName;

    //用户头像
    @Transient
    private String avatarUrl;

    //
    private String rate;

    //评论内容
    private String content;

    //商品id
    private Integer divId;

    //回复用户id
    private Integer replyUserId;

    //回复用户名
    private String replyUserName;

    //动态-图片id
    private String imageId;

    //动态-内容
    private String dynamicContent;

    //动态审核状态
    private Integer dynamicContentFlag;

    //评论时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")//JsonFormat是出参格式化。
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//DateTimeFormat 是入参格式化；
    private Date commentTime;
}
